<%--
  Created by IntelliJ IDEA.
  User: 于永祥
  Date: 2022/10/22
  Time: 18:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<c:set value="${pageContext.request.contextPath}" var="path"></c:set>
<table class="table table-hover align-middle">
    <thead>
    <tr>
        <th class="pxp-is-checkbox" style="width: 1%;"><input type="checkbox" class="form-check-input selectAll"></th>
        <th style="width: 25%;font-weight: bold;">职位名</th>
        <th style="width: 20%;font-weight: bold;">职位类别</th>
        <th style="width: 12%;font-weight: bold;">职位性质</th>
        <th style="width: 15%;font-weight: bold;">求职人数</th>
        <th style="font-weight: bold;">发布时间<span class="fa fa-angle-up ms-3"></span></th>
        <th>&nbsp;</th>
    </tr>
    </thead>
    <tbody>
    <input type="hidden" id="num" value="${requestScope.positions.total}">
    <c:forEach items="${requestScope.positions.list}" var="position">
        <tr>
            <td><input type="checkbox" class="form-check-input radio checked" data-id="${position.id}"></td>
            <td>
                <a href="#">
                    <div class="pxp-company-dashboard-job-title positionName">${position.positionName}</div>
                    <div class="pxp-company-dashboard-job-location"><span class="fa fa-globe me-1"></span>${position.province.provName} ${position.city.cityName} ${position.district.districtName}</div>
                </a>
            </td>
            <td><div style="font-weight: bold;" class="pxp-company-dashboard-job-category">${position.positionTypeSecond.typeName}</div></td>
            <c:if test="${position.fullTimeOn}" var="fullTime">
                <td><div style="font-weight: bold;" class="pxp-company-dashboard-job-type">全职</div></td>
            </c:if>
            <c:if test="${not fullTime}">
                <td><div style="font-weight: bold;" class="pxp-company-dashboard-job-type">兼职</div></td>
            </c:if>
            <td>
                <c:if test="${position.numberOfResumesDelivered eq 0}" var="num">
                    <a href="#" style="color: crimson;font-weight: bold;" class="pxp-company-dashboard-job-applications">暂无求职者</a>
                </c:if>
                <c:if test="${not num}">
                    <a style="font-weight: bold;" href="#" class="pxp-company-dashboard-job-applications">${position.numberOfResumesDelivered}个求职者</a>
                </c:if>
            </td>
            <td>
                <c:if test="${position.havePutOn}" var="havePutOn">
                    <div class="pxp-company-dashboard-job-status"><span class="badge rounded-pill bg-success">发表</span></div>
                </c:if>
                <c:if test="${not havePutOn}">
                    <div class="pxp-company-dashboard-job-status"><span class="badge rounded-pill bg-secondary">草稿</span></div>
                </c:if>
                <div style="font-weight: bold;" class="pxp-company-dashboard-job-date mt-1"><fmt:formatDate value="${position.enrollTime}" pattern="yyyy-MM-dd"></fmt:formatDate></div>
            </td>
            <td>
                <div class="pxp-dashboard-table-options">
                    <ul class="list-unstyled">
                        <li><button title="Edit"><span class="fa fa-pencil"></span></button></li>
                        <li><button title="Preview"><span class="fa fa-eye"></span></button></li>
                        <li><button title="Delete" class="delete" id="del${position.id}"><span class="fa fa-trash-o"></span></button></li>
                    </ul>
                </div>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>

<div class="row mt-4 mt-lg-5 justify-content-between align-items-center">
    <div class="col-auto">
        <nav class="mt-3 mt-sm-0" aria-label="Jobs list pagination">
            <ul class="pagination pxp-pagination">
                <li class="page-item"><a class="page-link lastPage" href="#">上一页</a></li>
                <c:forEach items="${requestScope.positions.navigatepageNums}" var="i">
                    <c:if test="${i==requestScope.positions.pageNum}" var="nowPage">
                        <li class="page-item active" aria-current="page">
                            <span class="page-link nowPage">${i}</span>
                        </li>
                    </c:if>
                    <c:if test="${not nowPage}">
                        <li class="page-item"><a class="page-link changePage" href="#">${i}</a></li>
                    </c:if>
                </c:forEach>
                <li class="page-item"><a class="page-link nextPage" href="#">下一页</a></li>
            </ul>
        </nav>
    </div>
</div>
